home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d27
/
autoflex.arc
/
KEYSDOWN.DOC
< prev
next >
Wrap
Text File
|
1990-06-15
|
2KB
|
65 lines
KEYSDOWN.COM is taken from July 1990 PC COMPUTING, page 218.
This short program will scan to see if the CAPLOCK, NUMLOCK or SCROLL
LOCK keys are on & if so return one of the errorlevels below:
** Scroll lock on returns an errorlevel of 16
** Num lock on returns an errorlevel of 32
** Cap lock on returns an errorlevel of 64
This in turn allows for the following type of batch file:
if not errorlevel 64 goto end
some command to be performed only if CAPLOCK key on
:end
Of course you substitute the appropriate errorlevel of your choice
per the above and you can use the positive as well as the negative
statement. Also remember that standard DOS will treat any number equal
to or greater then the given errorlevel number as a match. Thus if any
of the three above lock keys are on "if errorlevel 16" will be matched.
(If you have the command.com substitute 4DOS you can require an exact
match with "if errorlevel EQ 16" etc.).
WHY THIS IS AN INVALUABLE PROGRAM:
Keysdown.com can be used in an autoexec.bat to perform certain
commands if the lock key in question has been depressed after
the lock keys given their initial `flash on' during the config.sys
routine. This means that you can have your standard autoexec routine
run automatically unless you affirmatively choose to branch by pressing
one of the lock keys. No menus, no muss, no fuss. (Using 4DOS [see
note above] I have my machine set up to go to a menu without TSRs
routinely; go to the comm program directly if caplock is pressed; go to
the word processor directly if the scroll lock is pressed; and load
a TSR package and go to the menu if the num lock is pressed). Note that
some machines automatically turn the num lock key to on upon booting.
I also include two other small programs.
NUMLKOFF.COM which will turn the numlock key to off; and
LOCKOFF.COM which will turn all three lock keys (num, cap & scroll) to
off.
NOW IF SOMEONE COULD DEVELOPE A ROUTINE TO EFFECT THE SAME `no menus'
BRANCHING OFF OF THE CONFIG.SYS ALL WOULD TRULY BE GRAND.
KEYSDOWN.COM was compiled from the following debug script (using the
command `debug < keysdown.scr'):
KEYSDOWN.SCR (blank line after int 21 must be there)
n keysdown.com
a
mov ah,2
int 16
mov ah,4c
int 21
rcx
8
w
q